home *** CD-ROM | disk | FTP | other *** search
/ Freelog 117 / FreelogNo117-OctobreNovembre2013.iso / Programmation / jedit / jedit5.1.0install.exe / {app} / modes / csv.xml < prev    next >
Extensible Markup Language  |  2013-07-28  |  6KB  |  145 lines

  1. <?xml version="1.0"?>
  2.  
  3. <!DOCTYPE MODE SYSTEM "xmode.dtd">
  4.  
  5. <!--
  6.  
  7. Author: Jaco de Groot
  8. Version: 2.2 20070213
  9.  
  10. Comma Separated Values specification used for this mode:
  11.  
  12. A file containing table data where the fields are sperated by commas. Fields
  13. containing commas (,) or newlines must be quoted (surrounded by quotes (")).
  14. Quotes in quoted fields must be escaped with two quotes.
  15.  
  16. Highlighted are:
  17. - Even columns
  18. - Commas seperating values
  19. - Quotes surrounding values
  20. - Escaped quotes are highlighted.
  21.  
  22. It is also possible that semicolons are used instead of commas. Therefor the
  23. first rules check if the first separator found is a comma or a semicolon and
  24. then switch to the comma or semicolon rules.
  25.  
  26. -->
  27.  
  28. <MODE>
  29.     <PROPS>
  30.         <PROPERTY NAME="contextInsensitive" VALUE="true"/>
  31.     </PROPS>
  32.     <!-- Switch rules -->
  33.  
  34.     <RULES>
  35.         <SEQ TYPE="MARKUP" DELEGATE="ODD_QUOTED" AT_LINE_START="TRUE">"</SEQ>
  36.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_EVEN_QUOTED">,"</SEQ>
  37.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_EVEN_QUOTED">;"</SEQ>
  38.         <EOL_SPAN_REGEXP TYPE="MARKUP" HASH_CHAR="," DELEGATE="COMMA_LAST_COLUMN">,(?=[^,]*$)</EOL_SPAN_REGEXP>
  39.         <EOL_SPAN_REGEXP TYPE="MARKUP" HASH_CHAR=";" DELEGATE="SEMICOLON_LAST_COLUMN">;(?=[^;]*$)
  40.         </EOL_SPAN_REGEXP>
  41.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_EVEN">,</SEQ>
  42.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_EVEN">;</SEQ>
  43.     </RULES>
  44.  
  45.     <RULES SET="ODD_QUOTED">
  46.         <SEQ TYPE="MARKUP" DELEGATE="ODD_QUOTED">""</SEQ>
  47.         <SEQ_REGEXP TYPE="MARKUP" HASH_CHAR=""" DELEGATE="COMMA_MAIN">"(?=,[^"][^,]*$)</SEQ_REGEXP>
  48.         <SEQ_REGEXP TYPE="MARKUP" HASH_CHAR=""" DELEGATE="SEMICOLON_MAIN">"(?=;[^"][^;]*$)</SEQ_REGEXP>
  49.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_EVEN_QUOTED">","</SEQ>
  50.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_EVEN_QUOTED">";"</SEQ>
  51.         <SEQ_REGEXP TYPE="MARKUP" HASH_CHAR=""," DELEGATE="COMMA_MAIN">",$</SEQ_REGEXP>
  52.         <SEQ_REGEXP TYPE="MARKUP" HASH_CHAR="";" DELEGATE="SEMICOLON_MAIN">";$</SEQ_REGEXP>
  53.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_EVEN">",</SEQ>
  54.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_EVEN">";</SEQ>
  55.         <SEQ_REGEXP TYPE="MARKUP" HASH_CHAR=""" DELEGATE="MAIN">"$</SEQ_REGEXP>
  56.         <SEQ TYPE="MARKUP" DELEGATE="EVEN">"</SEQ>
  57.     </RULES>
  58.  
  59.     <RULES DEFAULT="COMMENT1" SET="EVEN">
  60.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_ODD_QUOTED">,"</SEQ>
  61.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_ODD_QUOTED">;"</SEQ>
  62.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_MAIN">,</SEQ>
  63.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_MAIN">;</SEQ>
  64.     </RULES>
  65.  
  66.     <RULES DEFAULT="COMMENT1" SET="EVEN_QUOTED">
  67.         <SEQ TYPE="MARKUP" DELEGATE="EVEN_QUOTED">""</SEQ>
  68.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_ODD_QUOTED">","</SEQ>
  69.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_ODD_QUOTED">";"</SEQ>
  70.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_MAIN">",</SEQ>
  71.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_MAIN">";</SEQ>
  72.         <SEQ TYPE="MARKUP" DELEGATE="MAIN">"</SEQ>
  73.     </RULES>
  74.  
  75.     <!-- Comma rules -->
  76.  
  77.     <RULES SET="COMMA_MAIN">
  78.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_ODD_QUOTED" AT_LINE_START="TRUE">"</SEQ>
  79.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_EVEN_QUOTED">,"</SEQ>
  80.         <EOL_SPAN_REGEXP TYPE="MARKUP" HASH_CHAR="," DELEGATE="COMMA_LAST_COLUMN">,(?=[^,]*$)</EOL_SPAN_REGEXP>
  81.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_EVEN">,</SEQ>
  82.     </RULES>
  83.  
  84.     <RULES SET="COMMA_ODD_QUOTED">
  85.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_ODD_QUOTED">""</SEQ>
  86.         <SEQ_REGEXP TYPE="MARKUP" HASH_CHAR=""" DELEGATE="COMMA_MAIN">"(?=,[^"][^,]*$)</SEQ_REGEXP>
  87.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_EVEN_QUOTED">","</SEQ>
  88.         <SEQ_REGEXP TYPE="MARKUP" HASH_CHAR=""," DELEGATE="COMMA_MAIN">",$</SEQ_REGEXP>
  89.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_EVEN">",</SEQ>
  90.         <SEQ_REGEXP TYPE="MARKUP" HASH_CHAR=""" DELEGATE="COMMA_MAIN">"$</SEQ_REGEXP>
  91.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_EVEN">"</SEQ>
  92.     </RULES>
  93.  
  94.     <RULES SET="COMMA_EVEN" DEFAULT="COMMENT1">
  95.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_ODD_QUOTED">,"</SEQ>
  96.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_MAIN">,</SEQ>
  97.     </RULES>
  98.  
  99.     <RULES SET="COMMA_EVEN_QUOTED" DEFAULT="COMMENT1">
  100.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_EVEN_QUOTED">""</SEQ>
  101.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_ODD_QUOTED">","</SEQ>
  102.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_MAIN">",</SEQ>
  103.         <SEQ TYPE="MARKUP" DELEGATE="COMMA_MAIN">"</SEQ>
  104.     </RULES>
  105.  
  106.     <RULES SET="COMMA_LAST_COLUMN" DEFAULT="COMMENT1">
  107.     </RULES>
  108.  
  109.     <!-- Semicolon rules -->
  110.  
  111.     <RULES SET="SEMICOLON_MAIN">
  112.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_ODD_QUOTED" AT_LINE_START="TRUE">"</SEQ>
  113.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_EVEN_QUOTED">;"</SEQ>
  114.         <EOL_SPAN_REGEXP TYPE="MARKUP" HASH_CHAR=";" DELEGATE="SEMICOLON_LAST_COLUMN">;(?=[^;]*$)
  115.         </EOL_SPAN_REGEXP>
  116.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_EVEN">;</SEQ>
  117.     </RULES>
  118.  
  119.     <RULES SET="SEMICOLON_ODD_QUOTED">
  120.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_ODD_QUOTED">""</SEQ>
  121.         <SEQ_REGEXP TYPE="MARKUP" HASH_CHAR=""" DELEGATE="SEMICOLON_MAIN">"(?=;[^"][^;]*$)</SEQ_REGEXP>
  122.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_EVEN_QUOTED">";"</SEQ>
  123.         <SEQ_REGEXP TYPE="MARKUP" HASH_CHAR="";" DELEGATE="SEMICOLON_MAIN">";$</SEQ_REGEXP>
  124.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_EVEN">";</SEQ>
  125.         <SEQ_REGEXP TYPE="MARKUP" HASH_CHAR=""" DELEGATE="SEMICOLON_MAIN">"$</SEQ_REGEXP>
  126.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_EVEN">"</SEQ>
  127.     </RULES>
  128.  
  129.     <RULES SET="SEMICOLON_EVEN" DEFAULT="COMMENT1">
  130.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_ODD_QUOTED">;"</SEQ>
  131.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_MAIN">;</SEQ>
  132.     </RULES>
  133.  
  134.     <RULES SET="SEMICOLON_EVEN_QUOTED" DEFAULT="COMMENT1">
  135.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_EVEN_QUOTED">""</SEQ>
  136.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_ODD_QUOTED">";"</SEQ>
  137.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_MAIN">";</SEQ>
  138.         <SEQ TYPE="MARKUP" DELEGATE="SEMICOLON_MAIN">"</SEQ>
  139.     </RULES>
  140.  
  141.     <RULES SET="SEMICOLON_LAST_COLUMN" DEFAULT="COMMENT1">
  142.     </RULES>
  143.  
  144. </MODE>
  145.